﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;

namespace QuanLyNhapXuat.Presentation.Report
{
    public partial class frm_reportChiPhi_Ngay : Form
    {
        public frm_reportChiPhi_Ngay()
        {
            InitializeComponent();
        }
        public DateTime NgayBD;
        public DateTime NgayKT;
        private void frm_reportChiPhi_Ngay_Load(object sender, EventArgs e)
        {
            repor_ChiPhiNgay report_ChiPhi_Ngay = new repor_ChiPhiNgay();
            ParameterFieldDefinitions crParameterFieldDefinitions;
            ParameterFieldDefinition crParameterFieldDefinition;
            ParameterValues crParameterValues = new ParameterValues();
            ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();

            crParameterDiscreteValue.Value = NgayBD;            
            crParameterFieldDefinitions = report_ChiPhi_Ngay.DataDefinition.ParameterFields;
            crParameterFieldDefinition = crParameterFieldDefinitions["@NgayBD"];
            crParameterValues = crParameterFieldDefinition.CurrentValues;
            crParameterValues.Clear();
            crParameterValues.Add(crParameterDiscreteValue);
            crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);

            crParameterDiscreteValue.Value = NgayKT;
            crParameterFieldDefinitions = report_ChiPhi_Ngay.DataDefinition.ParameterFields;
            crParameterFieldDefinition = crParameterFieldDefinitions["@NgayKT"];
            crParameterValues = crParameterFieldDefinition.CurrentValues;
            crParameterValues.Clear();
            crParameterValues.Add(crParameterDiscreteValue);
            crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);
            

            crystalReportViewer1.ReportSource = report_ChiPhi_Ngay;
            crystalReportViewer1.Refresh();
        }
    }
}
